#include "widget.h"

#include <QApplication>
#include <QObject>
#include <QLabel>
#include <QDebug>
#include <QFile>

#include "myobject.h"

// not include "main.moc" -- main.moc 是什么鬼？？
// class File : public QObject
// {
//     Q_OBJECT
// public:
//     File(QObject* parent = nullptr);
// private:
//     QFile file;
// };

void CreateObjects()
{


    // MyObject* grandparent = new MyObject(QString("grandparent"));
    // MyObject* parent = new MyObject(QString("parent"), grandparent);
    // MyObject* child = new MyObject(QString("child"), parent);

    // delete grandparent;
}

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    Widget w;

    QObject* parent = new QObject();
    QObject* child = new QObject(parent);

    parent->dumpObjectTree();

    // CreateObjects();

    // QObject* parent = new QObject();
    // QObject* child = new QObject();

    // child->setParent(parent);

    // QObject* grandparent = new QObject();
    // QObject* parent = new QObject(grandparent);
    // QObject* child = new QObject(parent);

    // qDebug() << "grandparent`s children: " << grandparent->children();
    // qDebug() << "parent`s children: " << parent->children();

    w.show();
    return a.exec();
}
